<template>
  <div>
    <div>
      <router-link to="/user/profile">Profile</router-link> |
      <router-link to="/user/posts">Posts</router-link>
    </div>
    <div>
      <keep-alive>
        <router-view :key="$route.path" name="user" />
      </keep-alive>
    </div>
  </div>
</template>

<script>
export default {
  name: 'User',
  mounted() {
    console.log('User mounted')
  },
  activated() {
    console.log('User activated')
  },
  deactivated() {
    console.log('User deactivated')
  },
  destroyed() {
    console.log('User destory')
  }
}
</script>
